package cn.jcet.mapreduce.inputformat;

import org.apache.hadoop.io.BytesWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

/**
 * @author 鲜磊
 * @Date 2020/12/8 23:19
 */
public class WholeReduce extends Reducer<Text,BytesWritable,Text,BytesWritable> {

    BytesWritable v = new BytesWritable();

    @Override
    protected void reduce(Text key, Iterable<BytesWritable> values, Context context) throws IOException, InterruptedException {

        for (BytesWritable value : values) {
            v.set(value);
        }
        context.write(key,v);
    }
}
